Re: [GENERAL] reatedb: database creation failed on mydb - Mailing list pgsql-general

From Herouth Maoz
Subject Re: [GENERAL] reatedb: database creation failed on mydb
Date
Msg-id l03130307b38033e807c4@[147.233.159.109]
Whole thread Raw
In response to reatedb: database creation failed on mydb  (taipan@shofiah.kusza.edu.my)
List pgsql-general
At 12:50 +0300 on 03/06/1999, taipan@shofiah.kusza.edu.my wrote:


> first I issue (under postgrest user)
>     createuser user_id
> then under that user_id I run
>     initlocation ~/sql/data
> then I run
>     createdb -D ~/sql/data mydb
>
> at this stage I get an error msg as below:
>     ERROR:  Unable to create database directory ~/sql/data/base/mydb
>     createdb: database creation failed on mydb.
>
> what should I do now? I tried to find it in archives but i can't find it.
> FYI I'm using postgres v 6.3 running under RedHat.

I think I know what the problem is. Remember that the one that creates the
database is the backend process. It basically creates a directory and
several files. It needs to be able to write in the location you specified.

Now, the backend process belongs to user postgres, whereas the directory in
which you want it to create the database belongs to the user user_id. So,
you have to give permission for writing to the postgres user in that
directory.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



pgsql-general by date:

Previous
From: "최진백"
Date:
Subject: alter table
Next
From: Herouth Maoz
Date:
Subject: Re: [GENERAL] PL/pgSQL help